package com.hyjiacan.apps.audionly.data.model

import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.*

/**
 * VideoFile实体类的单元测试
 */
class VideoFileTest {
    @Test
    fun `test VideoFile creation and property access`() {
        // 创建测试对象
        val videoFile = VideoFile(
            id = "1",
            name = "test_video.mp4",
            path = "/storage/emulated/0/Download/test_video.mp4",
            duration = 10000,
            size = 5242880,
            format = "mp4"
        )

        // 验证属性值
        assertEquals("1", videoFile.id)
        assertEquals("test_video.mp4", videoFile.name)
        assertEquals("/storage/emulated/0/Download/test_video.mp4", videoFile.path)
        assertEquals(10000, videoFile.duration)
        assertEquals(5242880, videoFile.size)
        assertEquals("mp4", videoFile.format)
    }

    @Test
    fun `test VideoFile copy method`() {
        // 创建原始对象
        val original = VideoFile(
            id = "1",
            name = "test_video.mp4",
            path = "/storage/emulated/0/Download/test_video.mp4",
            duration = 10000,
            size = 5242880,
            format = "mp4"
        )

        // 测试部分属性修改的复制
        val copied = original.copy(
            name = "copied_video.mp4",
            duration = 20000
        )

        // 验证复制后的对象
        assertEquals(original.id, copied.id)
        assertEquals("copied_video.mp4", copied.name)
        assertEquals(original.path, copied.path)
        assertEquals(20000, copied.duration)
        assertEquals(original.size, copied.size)
        assertEquals(original.format, copied.format)
    }
}